package es.ceura.wilder.controllers;

import es.ceura.wilder.actions.Action;
import es.ceura.wilder.actions.ActionType;
import es.ceura.wilder.actions.Get;
import es.ceura.wilder.actions.Post;
import java.util.HashMap;

/**
 *
 * @author Jorge Madrid
 */
public class ActionController {

    private HashMap<ActionType, Action> actionMap;

    public ActionController() {
        actionMap = new HashMap<>();

        initActions();
    }

    private void initActions() {
        actionMap.put(ActionType.GET, new Get());
        actionMap.put(ActionType.POST, new Post());
    }

    public Action getAction(ActionType actionType) {
        return actionMap.get(actionType);
    }
}
